package com.lk.passport.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;


@Configuration
public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter {


    @Override
    protected void configure(HttpSecurity http) throws Exception {
        // 表单登录配置项
//        http.formLogin()//认证方式
        http.httpBasic()//认证方式
                .and()
                .authorizeRequests()//请求授权
                .anyRequest()//任何请求
                .authenticated()//需要认证
        ;

    }
}
